package com.demo.ctf;
import java.util.concurrent.CompletableFuture;
public class FutureThenRunDemo {
    public static void main(String[] args) throws Exception {
        CompletableFuture<String> orgFuture = CompletableFuture.supplyAsync(
                ()->{
                    System.out.println("1.supplyAsync");
                    return "1.supplyAsync";
                }
        );
        CompletableFuture thenRunFuture = orgFuture.thenRun(() -> {
            System.out.println("2.thenRun");
        });
        System.out.println(thenRunFuture.get());
    }
}
